<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <button>传统注册事件</button>
    <button>方法监听注册事件</button>
    <button>ie9 attachEvent</button>
    
</body>

<script>
    let buttons = document.querySelectorAll('button');
    console.log(buttons);
    buttons[0].onclick = function(){
        alert('点击');
    }
    buttons[0].onmouseover = function(){
        //alert('经过');
    }
    buttons[1].addEventListener('click',function(){alert('haha')});
</script>

</html>